function b(count){
    let sum=0
    while(count>0){
        let i=count%10;
        sum=sum+i;
        count=Math.floor(count/10);
    }
    return sum;

}
console.log(b(123));